--[[
--函数9:lua_video_set_state
--功能:设置state
--参数:ARGV[1]:doc_id:23
--参数:ARGV[2]:state:1(1生成中,2生成失败,3生成成功)
--返回: 0成功 1失败
-- ]]--

local PREFIX_DOC = "doc_id_"
local key = PREFIX_DOC..ARGV[1]
redis.call("hset",key,"state",ARGV[2])
local s = redis.call("hget",key,"state")
local state = tonumber(s) or 0
local paramState = tonumber(ARGV[2]) or 0
if(state == paramState)
then
    return 0
end
return 1

